﻿namespace ExamV5.PaperInfo
{
    using ExamV5;
    using System;
    using System.Configuration;
    using System.Data;
    using System.Data.SqlClient;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;

    public class FrmEditPaperTemplet : Page
    {
        protected Button butClose;
        protected Button butEnter;
        protected DropDownList DDLDiffculty;
        protected HtmlForm form1;
        protected HtmlHead Head1;
        private HttpCookie httpCookie_0 = null;
        private HttpCookie httpCookie_1 = null;
        private HttpCookie httpCookie_2 = null;
        private HttpCookie httpCookie_3 = null;
        private int int_0 = 0;
        protected Label labRubricAFenTip;
        protected Label labRubricASumTip;
        protected Label labRubricBFenTip;
        protected Label labRubricBSumTip;
        protected Label labRubricCFenTip;
        protected Label labRubricCSumTip;
        protected Label labRubricDFenTip;
        protected Label labRubricDSumTip;
        protected Label labRubricEFenTip;
        protected Label labRubricESumTip;
        protected Label labRubricFFenTip;
        protected Label labRubricFSumTip;
        protected Label labRubricGFenTip;
        protected Label labRubricGSumTip;
        protected Label labRubricHFenTip;
        protected Label labRubricHSumTip;
        protected Label labRubricIFenTip;
        protected Label labRubricISumTip;
        private PublicFun publicFun_0 = new PublicFun();
        protected RadioButtonList RBLExamShow;
        protected RadioButtonList RBLExamType;
        protected RadioButtonList RBLRubricShow;
        protected TextBox txtAErrFen;
        protected TextBox txtANoWriteFen;
        protected TextBox txtBErrFen;
        protected TextBox txtBNoWriteFen;
        protected TextBox txtCErrFen;
        protected TextBox txtCNoWriteFen;
        protected TextBox txtEndIP;
        protected TextBox txtExamName;
        protected TextBox txtExamTime;
        protected TextBox txtPaperSumFen;
        protected TextBox txtRubricAFen;
        protected TextBox txtRubricAMemo;
        protected TextBox txtRubricASum;
        protected TextBox txtRubricATip;
        protected TextBox txtRubricBFen;
        protected TextBox txtRubricBMemo;
        protected TextBox txtRubricBSum;
        protected TextBox txtRubricBTip;
        protected TextBox txtRubricCFen;
        protected TextBox txtRubricCMemo;
        protected TextBox txtRubricCSum;
        protected TextBox txtRubricCTip;
        protected TextBox txtRubricDFen;
        protected TextBox txtRubricDMemo;
        protected TextBox txtRubricDSum;
        protected TextBox txtRubricDTip;
        protected TextBox txtRubricEFen;
        protected TextBox txtRubricEMemo;
        protected TextBox txtRubricESum;
        protected TextBox txtRubricETip;
        protected TextBox txtRubricFFen;
        protected TextBox txtRubricFMemo;
        protected TextBox txtRubricFSum;
        protected TextBox txtRubricFTip;
        protected TextBox txtRubricGFen;
        protected TextBox txtRubricGMemo;
        protected TextBox txtRubricGSum;
        protected TextBox txtRubricGTip;
        protected TextBox txtRubricHFen;
        protected TextBox txtRubricHMemo;
        protected TextBox txtRubricHSum;
        protected TextBox txtRubricHTip;
        protected TextBox txtRubricIFen;
        protected TextBox txtRubricIMemo;
        protected TextBox txtRubricISum;
        protected TextBox txtRubricITip;
        protected TextBox txtStartIP;

        protected void butEnter_Click(object sender, EventArgs e)
        {
            string strSql = "";
            int num = 0;
            int num2 = 0;
            double num3 = 0.0;
            int num4 = 0;
            double num5 = 0.0;
            int num6 = 0;
            double num7 = 0.0;
            int num8 = 0;
            double num9 = 0.0;
            int num10 = 0;
            double num11 = 0.0;
            int num12 = 0;
            double num13 = 0.0;
            int num14 = 0;
            double num15 = 0.0;
            int num16 = 0;
            double num17 = 0.0;
            int num18 = 0;
            double num19 = 0.0;
            int num20 = 0;
            double num21 = 0.0;
            double num22 = 0.0;
            double num23 = 0.0;
            double num24 = 0.0;
            double num25 = 0.0;
            double num26 = 0.0;
            try
            {
                num = Convert.ToInt32(this.txtPaperSumFen.Text.Trim());
            }
            catch
            {
                base.Response.Write("<script>alert('试卷总分输入不合法！')</script");
                return;
            }
            if (this.txtRubricASum.Text.Trim() == "")
            {
                base.Response.Write("<script>alert('请输入" + this.txtRubricATip.Text + "题数！')</script");
            }
            else
            {
                try
                {
                    num2 = Convert.ToInt32(this.txtRubricASum.Text.Trim());
                }
                catch
                {
                    base.Response.Write("<script>alert('" + this.txtRubricATip.Text + "题数输入不合法！')</script");
                    return;
                }
                if (this.txtRubricAFen.Text.Trim() == "")
                {
                    base.Response.Write("<script>alert('请输入" + this.txtRubricATip.Text + "分值！')</script");
                }
                else
                {
                    try
                    {
                        num3 = Convert.ToDouble(this.txtRubricAFen.Text.Trim());
                    }
                    catch
                    {
                        base.Response.Write("<script>alert('" + this.txtRubricATip.Text + "分值不合法！')</script");
                        return;
                    }
                    try
                    {
                        num24 = Convert.ToDouble(this.txtANoWriteFen.Text.Trim());
                    }
                    catch
                    {
                        base.Response.Write("<script>alert('" + this.txtRubricATip.Text + "未答倒扣分值不合法！')</script");
                        return;
                    }
                    try
                    {
                        num21 = Convert.ToDouble(this.txtAErrFen.Text.Trim());
                    }
                    catch
                    {
                        base.Response.Write("<script>alert('" + this.txtRubricATip.Text + "答错倒扣分值不合法！')</script");
                        return;
                    }
                    if (this.txtRubricBSum.Text.Trim() == "")
                    {
                        base.Response.Write("<script>alert('请输入" + this.txtRubricBTip.Text + "题数！')</script");
                    }
                    else
                    {
                        try
                        {
                            num4 = Convert.ToInt32(this.txtRubricBSum.Text.Trim());
                        }
                        catch
                        {
                            base.Response.Write("<script>alert('" + this.txtRubricBTip.Text + "题数输入不合法！')</script");
                            return;
                        }
                        if (this.txtRubricBFen.Text.Trim() == "")
                        {
                            base.Response.Write("<script>alert('请输入" + this.txtRubricBTip.Text + "分值！')</script");
                        }
                        else
                        {
                            try
                            {
                                num5 = Convert.ToDouble(this.txtRubricBFen.Text.Trim());
                            }
                            catch
                            {
                                base.Response.Write("<script>alert('" + this.txtRubricBTip.Text + "分值不合法！')</script");
                                return;
                            }
                            try
                            {
                                num25 = Convert.ToDouble(this.txtBNoWriteFen.Text.Trim());
                            }
                            catch
                            {
                                base.Response.Write("<script>alert('" + this.txtRubricBTip.Text + "未答倒扣分值不合法！')</script");
                                return;
                            }
                            try
                            {
                                num22 = Convert.ToDouble(this.txtBErrFen.Text.Trim());
                            }
                            catch
                            {
                                base.Response.Write("<script>alert('" + this.txtRubricBTip.Text + "答错倒扣分值不合法！')</script");
                                return;
                            }
                            if (this.txtRubricCSum.Text.Trim() == "")
                            {
                                base.Response.Write("<script>alert('请输入" + this.txtRubricCTip.Text + "题数！')</script");
                            }
                            else
                            {
                                try
                                {
                                    num6 = Convert.ToInt32(this.txtRubricCSum.Text.Trim());
                                }
                                catch
                                {
                                    base.Response.Write("<script>alert('" + this.txtRubricCTip.Text + "题数输入不合法！')</script");
                                    return;
                                }
                                if (this.txtRubricCFen.Text.Trim() == "")
                                {
                                    base.Response.Write("<script>alert('请输入" + this.txtRubricCTip.Text + "分值！')</script");
                                }
                                else
                                {
                                    try
                                    {
                                        num7 = Convert.ToDouble(this.txtRubricCFen.Text.Trim());
                                    }
                                    catch
                                    {
                                        base.Response.Write("<script>alert('" + this.txtRubricCTip.Text + "分值不合法！')</script");
                                        return;
                                    }
                                    try
                                    {
                                        num26 = Convert.ToDouble(this.txtCNoWriteFen.Text.Trim());
                                    }
                                    catch
                                    {
                                        base.Response.Write("<script>alert('" + this.txtRubricCTip.Text + "未答倒扣分值不合法！')</script");
                                        return;
                                    }
                                    try
                                    {
                                        num23 = Convert.ToDouble(this.txtCErrFen.Text.Trim());
                                    }
                                    catch
                                    {
                                        base.Response.Write("<script>alert('" + this.txtRubricCTip.Text + "答错倒扣分值不合法！')</script");
                                        return;
                                    }
                                    if (this.txtRubricDSum.Text.Trim() == "")
                                    {
                                        base.Response.Write("<script>alert('请输入" + this.txtRubricDTip.Text + "题数！')</script");
                                    }
                                    else
                                    {
                                        try
                                        {
                                            num8 = Convert.ToInt32(this.txtRubricDSum.Text.Trim());
                                        }
                                        catch
                                        {
                                            base.Response.Write("<script>alert('" + this.txtRubricDTip.Text + "题数输入不合法！')</script");
                                            return;
                                        }
                                        if (this.txtRubricDFen.Text.Trim() == "")
                                        {
                                            base.Response.Write("<script>alert('请输入" + this.txtRubricDTip.Text + "分值！')</script");
                                        }
                                        else
                                        {
                                            try
                                            {
                                                num9 = Convert.ToDouble(this.txtRubricDFen.Text.Trim());
                                            }
                                            catch
                                            {
                                                base.Response.Write("<script>alert('" + this.txtRubricDTip.Text + "分值不合法！')</script");
                                                return;
                                            }
                                            if (this.txtRubricESum.Text.Trim() == "")
                                            {
                                                base.Response.Write("<script>alert('请输入" + this.txtRubricETip.Text + "题数！')</script");
                                            }
                                            else
                                            {
                                                try
                                                {
                                                    num10 = Convert.ToInt32(this.txtRubricESum.Text.Trim());
                                                }
                                                catch
                                                {
                                                    base.Response.Write("<script>alert('" + this.txtRubricETip.Text + "题数输入不合法！')</script");
                                                    return;
                                                }
                                                if (this.txtRubricEFen.Text.Trim() == "")
                                                {
                                                    base.Response.Write("<script>alert('请输入" + this.txtRubricETip.Text + "分值！')</script");
                                                }
                                                else
                                                {
                                                    try
                                                    {
                                                        num11 = Convert.ToDouble(this.txtRubricEFen.Text.Trim());
                                                    }
                                                    catch
                                                    {
                                                        base.Response.Write("<script>alert('" + this.txtRubricETip.Text + "分值不合法！')</script");
                                                        return;
                                                    }
                                                    if (this.txtRubricFSum.Text.Trim() == "")
                                                    {
                                                        base.Response.Write("<script>alert('请输入" + this.txtRubricFTip.Text + "题数！')</script");
                                                    }
                                                    else
                                                    {
                                                        try
                                                        {
                                                            num12 = Convert.ToInt32(this.txtRubricFSum.Text.Trim());
                                                        }
                                                        catch
                                                        {
                                                            base.Response.Write("<script>alert('" + this.txtRubricFTip.Text + "题数输入不合法！')</script");
                                                            return;
                                                        }
                                                        if (this.txtRubricFFen.Text.Trim() == "")
                                                        {
                                                            base.Response.Write("<script>alert('请输入" + this.txtRubricFTip.Text + "分值！')</script");
                                                        }
                                                        else
                                                        {
                                                            try
                                                            {
                                                                num13 = Convert.ToDouble(this.txtRubricFFen.Text.Trim());
                                                            }
                                                            catch
                                                            {
                                                                base.Response.Write("<script>alert('" + this.txtRubricFTip.Text + "分值不合法！')</script");
                                                                return;
                                                            }
                                                            if (this.txtRubricGSum.Text.Trim() == "")
                                                            {
                                                                base.Response.Write("<script>alert('请输入" + this.txtRubricGTip.Text + "题数！')</script");
                                                            }
                                                            else
                                                            {
                                                                try
                                                                {
                                                                    num14 = Convert.ToInt32(this.txtRubricGSum.Text.Trim());
                                                                }
                                                                catch
                                                                {
                                                                    base.Response.Write("<script>alert('" + this.txtRubricGTip.Text + "题数输入不合法！')</script");
                                                                    return;
                                                                }
                                                                if (this.txtRubricGFen.Text.Trim() == "")
                                                                {
                                                                    base.Response.Write("<script>alert('请输入" + this.txtRubricGTip.Text + "分值！')</script");
                                                                }
                                                                else
                                                                {
                                                                    try
                                                                    {
                                                                        num15 = Convert.ToDouble(this.txtRubricGFen.Text.Trim());
                                                                    }
                                                                    catch
                                                                    {
                                                                        base.Response.Write("<script>alert('" + this.txtRubricGTip.Text + "分值不合法！')</script");
                                                                        return;
                                                                    }
                                                                    if (this.txtRubricHSum.Text.Trim() == "")
                                                                    {
                                                                        base.Response.Write("<script>alert('请输入" + this.txtRubricHTip.Text + "题数！')</script");
                                                                    }
                                                                    else
                                                                    {
                                                                        try
                                                                        {
                                                                            num16 = Convert.ToInt32(this.txtRubricHSum.Text.Trim());
                                                                        }
                                                                        catch
                                                                        {
                                                                            base.Response.Write("<script>alert('" + this.txtRubricHTip.Text + "题数输入不合法！')</script");
                                                                            return;
                                                                        }
                                                                        if (this.txtRubricHFen.Text.Trim() == "")
                                                                        {
                                                                            base.Response.Write("<script>alert('请输入" + this.txtRubricHTip.Text + "分值！')</script");
                                                                        }
                                                                        else
                                                                        {
                                                                            try
                                                                            {
                                                                                num17 = Convert.ToDouble(this.txtRubricHFen.Text.Trim());
                                                                            }
                                                                            catch
                                                                            {
                                                                                base.Response.Write("<script>alert('" + this.txtRubricHTip.Text + "分值不合法！')</script");
                                                                                return;
                                                                            }
                                                                            if (this.txtRubricISum.Text.Trim() == "")
                                                                            {
                                                                                base.Response.Write("<script>alert('请输入" + this.txtRubricITip.Text + "题数！')</script");
                                                                            }
                                                                            else
                                                                            {
                                                                                try
                                                                                {
                                                                                    num18 = Convert.ToInt32(this.txtRubricISum.Text.Trim());
                                                                                }
                                                                                catch
                                                                                {
                                                                                    base.Response.Write("<script>alert('" + this.txtRubricITip.Text + "题数输入不合法！')</script");
                                                                                    return;
                                                                                }
                                                                                if (this.txtRubricIFen.Text.Trim() == "")
                                                                                {
                                                                                    base.Response.Write("<script>alert('请输入" + this.txtRubricITip.Text + "分值！')</script");
                                                                                }
                                                                                else
                                                                                {
                                                                                    try
                                                                                    {
                                                                                        num19 = Convert.ToDouble(this.txtRubricIFen.Text.Trim());
                                                                                    }
                                                                                    catch
                                                                                    {
                                                                                        base.Response.Write("<script>alert('" + this.txtRubricITip.Text + "分值不合法！')</script");
                                                                                        return;
                                                                                    }
                                                                                    try
                                                                                    {
                                                                                        num20 = Convert.ToInt32(this.txtExamTime.Text.Trim());
                                                                                    }
                                                                                    catch
                                                                                    {
                                                                                        base.Response.Write("<script>alert('考试时间输入不合法！')</script");
                                                                                        return;
                                                                                    }
                                                                                    double num28 = 0.0;
                                                                                    num28 = ((((((((num2 * num3) + (num4 * num5)) + (num6 * num7)) + (num8 * num9)) + (num10 * num11)) + (num12 * num13)) + (num14 * num15)) + (num16 * num17)) + (num18 * num19);
                                                                                    if (num != Convert.ToInt16(num28))
                                                                                    {
                                                                                        base.Response.Write("<script>alert('试卷总分与题型分值总和不一致！')</script");
                                                                                    }
                                                                                    else
                                                                                    {
                                                                                        string[] strArray2 = this.txtStartIP.Text.Trim().Split(new char[] { '.' });
                                                                                        string[] strArray3 = this.txtEndIP.Text.Trim().Split(new char[] { '.' });
                                                                                        if (strArray2.Length != 4)
                                                                                        {
                                                                                            base.Response.Write("<script>alert('IP地址不合法！')</script");
                                                                                        }
                                                                                        else if (strArray3.Length != 4)
                                                                                        {
                                                                                            base.Response.Write("<script>alert('IP地址不合法！')</script");
                                                                                        }
                                                                                        else
                                                                                        {
                                                                                            for (int i = 0; i < strArray2.Length; i++)
                                                                                            {
                                                                                                if ((((int.Parse(strArray2[i]) < 0) || (int.Parse(strArray2[i]) > 0xff)) || (int.Parse(strArray3[i]) < 0)) || (int.Parse(strArray3[i]) > 0xff))
                                                                                                {
                                                                                                    base.Response.Write("<script>alert('IP地址不合法！')</script");
                                                                                                    return;
                                                                                                }
                                                                                            }
                                                                                            string str7 = this.txtRubricATip.Text.Trim() + "#" + this.txtRubricBTip.Text.Trim() + "#" + this.txtRubricCTip.Text.Trim() + "#" + this.txtRubricDTip.Text.Trim() + "#" + this.txtRubricETip.Text.Trim() + "#" + this.txtRubricFTip.Text.Trim() + "#" + this.txtRubricGTip.Text.Trim() + "#" + this.txtRubricHTip.Text.Trim() + "#" + this.txtRubricITip.Text.Trim() + "#";
                                                                                            string str4 = num2.ToString() + "#" + num4.ToString() + "#" + num6.ToString() + "#" + num8.ToString() + "#" + num10.ToString() + "#" + num12.ToString() + "#" + num14.ToString() + "#" + num16.ToString() + "#" + num18.ToString();
                                                                                            string str5 = num3.ToString() + "#" + num5.ToString() + "#" + num7.ToString() + "#" + num9.ToString() + "#" + num11.ToString() + "#" + num13.ToString() + "#" + num15.ToString() + "#" + num17.ToString() + "#" + num19.ToString();
                                                                                            string str6 = this.txtRubricAMemo.Text.Trim() + "#" + this.txtRubricBMemo.Text.Trim() + "#" + this.txtRubricCMemo.Text.Trim() + "#" + this.txtRubricDMemo.Text.Trim() + "#" + this.txtRubricEMemo.Text.Trim() + "#" + this.txtRubricFMemo.Text.Trim() + "#" + this.txtRubricGMemo.Text.Trim() + "#" + this.txtRubricHMemo.Text.Trim() + "#" + this.txtRubricIMemo.Text.Trim().Replace("#", "＃");
                                                                                            string str3 = num21.ToString() + "#" + num22.ToString() + "#" + num23.ToString() + "#######";
                                                                                            string str2 = num24.ToString() + "#" + num25.ToString() + "#" + num26.ToString() + "#######";
                                                                                            if (this.int_0 == 0)
                                                                                            {
                                                                                                strSql = "insert into TemplatePaper(NoWriteFen,ErrorFen,TemplateName,PaperSumFen,Difficult,RubricDist,FenDist,MemoDist,ExamTime,IsShow,StartIP,EndIP,PaperStatus,OutputType,InputMan,RubricTypeName)";
                                                                                                strSql = string.Concat(new object[] { 
                                                                                                    strSql, " values('", str2, "','", str3, "','", this.publicFun_0.CheckString(this.txtExamName.Text), "','", num, "','", this.DDLDiffculty.SelectedItem.Value, "','", str4, "','", str5, "','", 
                                                                                                    str6, "','", num20, "','", this.RBLExamShow.SelectedItem.Value, "','", this.txtStartIP.Text.Trim(), "','", this.txtEndIP.Text.Trim(), "','", this.RBLExamType.SelectedItem.Value, "','", this.RBLRubricShow.SelectedItem.Value, "','", this.httpCookie_1.Value, "','", 
                                                                                                    str7, "')"
                                                                                                 });
                                                                                                strSql = strSql + ";insert into SysLogInfo(LogDisp,EditUser,EditUserCode) values('添加试卷模板信息操作成功！','" + this.httpCookie_1.Value + "','" + this.httpCookie_0.Value + "')";
                                                                                                this.publicFun_0.ExecuteSql(strSql);
                                                                                                base.Response.Write("<script>alert('添加试卷模板操作成功！');window.opener.location.reload();window.close();</script>");
                                                                                            }
                                                                                            else
                                                                                            {
                                                                                                strSql = string.Concat(new object[] { 
                                                                                                    "update TemplatePaper set NoWriteFen='", str2, "',ErrorFen='", str3, "',InputTime=getdate(),InputMan='", this.httpCookie_1.Value, "',StartIP='", this.txtStartIP.Text.Trim(), "',EndIP='", this.txtEndIP.Text.Trim(), "',IsShow='", this.RBLExamShow.SelectedItem.Value, "',RubricTypeName='", str7, "',OutPutType='", this.RBLRubricShow.SelectedItem.Value, 
                                                                                                    "',TemplateName='", this.publicFun_0.CheckString(this.txtExamName.Text), "',PaperSumFen=", num, ",Difficult='", this.DDLDiffculty.SelectedItem.Value, "',"
                                                                                                 });
                                                                                                strSql = string.Concat(new object[] { strSql, "RubricDist='", str4.Trim(), "',FenDist='", str5.Trim(), "',MemoDist='", str6.Trim(), "',ExamTime=", num20, ",PaperStatus='", this.RBLExamType.SelectedItem.Value, "'  where ID=", this.int_0 });
                                                                                                strSql = strSql + ";insert into SysLogInfo(LogDisp,EditUser,EditUserCode) values('修改试卷模板信息操作成功！','" + this.httpCookie_1.Value + "','" + this.httpCookie_0.Value + "')";
                                                                                                this.publicFun_0.ExecuteSql(strSql);
                                                                                                base.Response.Write("<script>alert('编辑试卷模板操作成功！');window.close();</script>");
                                                                                            }
                                                                                        }
                                                                                    }
                                                                                }
                                                                            }
                                                                        }
                                                                    }
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }

        private void method_0()
        {
            SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["Conn"].ConnectionString);
            connection.Open();
            SqlCommand command = new SqlCommand("select * from TemplatePaper where ID=" + Convert.ToInt32(base.Request["ID"].ToString()), connection);
            SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection);
            if (reader.Read())
            {
                this.RBLExamShow.SelectedIndex = -1;
                this.txtStartIP.Text = reader["StartIP"].ToString();
                this.txtEndIP.Text = reader["EndIP"].ToString();
                this.RBLExamShow.Items.FindByValue(reader["IsShow"].ToString()).Selected = true;
                this.txtExamName.Text = reader["TemplateName"].ToString();
                this.RBLRubricShow.SelectedIndex = -1;
                this.RBLRubricShow.Items.FindByValue(reader["OutPutType"].ToString()).Selected = true;
                this.DDLDiffculty.SelectedIndex = -1;
                this.DDLDiffculty.Items.FindByValue(reader["Difficult"].ToString()).Selected = true;
                this.RBLExamType.SelectedIndex = -1;
                this.RBLExamType.Items.FindByValue(reader["PaperStatus"].ToString()).Selected = true;
                this.txtPaperSumFen.Text = reader["PaperSumFen"].ToString();
                string[] strArray = reader["RubricDist"].ToString().Split(new char[] { '#' });
                string[] strArray2 = reader["FenDist"].ToString().Split(new char[] { '#' });
                string[] strArray3 = reader["MemoDist"].ToString().Split(new char[] { '#' });
                string[] strArray4 = reader["NoWriteFen"].ToString().Split(new char[] { '#' });
                string[] strArray5 = reader["ErrorFen"].ToString().Split(new char[] { '#' });
                this.txtAErrFen.Text = strArray5[0].ToString();
                this.txtBErrFen.Text = strArray5[1].ToString();
                this.txtCErrFen.Text = strArray5[2].ToString();
                this.txtANoWriteFen.Text = strArray4[0].ToString();
                this.txtBNoWriteFen.Text = strArray4[1].ToString();
                this.txtCNoWriteFen.Text = strArray4[2].ToString();
                this.txtRubricASum.Text = strArray[0].ToString();
                this.txtRubricAFen.Text = strArray2[0].ToString();
                this.txtRubricAMemo.Text = strArray3[0].ToString();
                this.txtRubricBSum.Text = strArray[1].ToString();
                this.txtRubricBFen.Text = strArray2[1].ToString();
                this.txtRubricBMemo.Text = strArray3[1].ToString();
                this.txtRubricCSum.Text = strArray[2].ToString();
                this.txtRubricCFen.Text = strArray2[2].ToString();
                this.txtRubricCMemo.Text = strArray3[2].ToString();
                this.txtRubricDSum.Text = strArray[3].ToString();
                this.txtRubricDFen.Text = strArray2[3].ToString();
                this.txtRubricDMemo.Text = strArray3[3].ToString();
                this.txtRubricESum.Text = strArray[4].ToString();
                this.txtRubricEFen.Text = strArray2[4].ToString();
                this.txtRubricEMemo.Text = strArray3[4].ToString();
                this.txtRubricFSum.Text = strArray[5].ToString();
                this.txtRubricFFen.Text = strArray2[5].ToString();
                this.txtRubricFMemo.Text = strArray3[5].ToString();
                this.txtRubricGSum.Text = strArray[6].ToString();
                this.txtRubricGFen.Text = strArray2[6].ToString();
                this.txtRubricGMemo.Text = strArray3[6].ToString();
                this.txtRubricHSum.Text = strArray[7].ToString();
                this.txtRubricHFen.Text = strArray2[7].ToString();
                this.txtRubricHMemo.Text = strArray3[7].ToString();
                this.txtRubricISum.Text = strArray[8].ToString();
                this.txtRubricIFen.Text = strArray2[8].ToString();
                this.txtRubricIMemo.Text = strArray3[8].ToString();
                this.txtExamTime.Text = reader["ExamTime"].ToString();
                string[] strArray6 = reader["RubricTypeName"].ToString().Split(new char[] { '#' });
                this.txtRubricATip.Text = strArray6[0].Trim();
                this.txtRubricBTip.Text = strArray6[1].Trim();
                this.txtRubricCTip.Text = strArray6[2].Trim();
                this.txtRubricDTip.Text = strArray6[3].Trim();
                this.txtRubricETip.Text = strArray6[4].Trim();
                this.txtRubricFTip.Text = strArray6[5].Trim();
                this.txtRubricGTip.Text = strArray6[6].Trim();
                this.txtRubricHTip.Text = strArray6[7].Trim();
                this.txtRubricITip.Text = strArray6[8].Trim();
            }
            reader.Close();
            command.Dispose();
            connection.Close();
            connection.Dispose();
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            this.httpCookie_0 = new HttpCookie("ExamUserCode");
            this.httpCookie_0 = base.Request.Cookies["ExamUserCode"];
            this.httpCookie_1 = new HttpCookie("ExamUserName");
            this.httpCookie_1 = base.Request.Cookies["ExamUserName"];
            this.httpCookie_2 = new HttpCookie("ExamUserLevel");
            this.httpCookie_2 = base.Request.Cookies["ExamUserLevel"];
            this.httpCookie_3 = new HttpCookie("ExamDeptID");
            this.httpCookie_3 = base.Request.Cookies["ExamDeptID"];
            if ((this.httpCookie_0 != null) ? !(this.httpCookie_0.Value == "") : false)
            {
                base.Response.Cache.SetCacheability(HttpCacheability.NoCache);
                base.Response.Cache.SetNoStore();
                this.httpCookie_0.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_0.Value));
                this.httpCookie_1.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_1.Value));
                this.httpCookie_2.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_2.Value));
                this.httpCookie_3.Value = this.publicFun_0.CheckString(base.Server.UrlDecode(this.httpCookie_3.Value));
                this.int_0 = Convert.ToInt32(base.Request["ID"].ToString());
                if (!base.IsPostBack)
                {
                    if (this.publicFun_0.ReturnPaperData() != "Yes")
                    {
                        base.Response.Write("<script>alert('此版本暂未授权,请拔打(0)13870606104手机号进行授权！')</script>");
                    }
                    else
                    {
                        this.ViewState["UserPwoer"] = this.publicFun_0.GetValues("select PaperTemple from UserPower where UserCode='" + this.httpCookie_0.Value + "'", "PaperTemple");
                        this.Page.Title = ConfigurationManager.ConnectionStrings["ProTitle"].ConnectionString;
                        if (!(this.ViewState["UserPwoer"].ToString() != "Y"))
                        {
                            this.butEnter.Enabled = true;
                            if (this.int_0 != 0)
                            {
                                this.method_0();
                            }
                        }
                        else
                        {
                            this.butEnter.Enabled = false;
                            base.Response.Write("<script>alert('试卷模板权限未开放！')</script>");
                        }
                    }
                }
            }
            else
            {
                base.Response.Write("<script language=javascript>top.location.href='../Index.htm';self.close();</script>");
            }
        }
    }
}

